pub fn is_num_or_letter(n: u8) -> bool {
    let up_a = 'A' as u8;
    let up_z = 'Z' as u8;
    let a = 'a' as u8;
    let z = 'z' as u8;
    let u8_0 = '0' as u8;
    let u8_9 = '9' as u8;
    return n >= u8_0 && n <= u8_9 || n >= up_a && n <= up_z || n >= a && n <= z;
}

pub fn is_palindrome(s: String) -> bool {
    let s = s.to_lowercase();
    let bytes = s.as_bytes();
    let mut end = bytes.len();
    let mut start = 1;
    while start < end {
        let start_byte = bytes[start - 1];
        let end_byte = bytes[end - 1];
        if !is_num_or_letter(start_byte) {
            start += 1;
            continue;
        }
        if !is_num_or_letter(end_byte) {
            end -= 1;
            continue;
        }
        if start_byte != end_byte {
            return false;
        }
        start += 1;
        end -= 1;
    }
    return true;
}
